/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.Views;

/**
 * changeStatusRoom.java
 *
 * @author Renato ferreira dos santos
 * Created on 23/03/2010, 13:18:21
 */
import java.awt.GridLayout;
import java.awt.MouseInfo;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import rad.Java.MotelPlus.Class.StateApt;

public class changeStatusRoom extends JDialog {

   //private static final long serialVersionUID = 1L;
   private JComboBox cmbStatus;
   private StateApt _status;

   public changeStatusRoom(){
         setTitle("Escolha o status dessa potrona");
         setModal(true);
         setLayout(new GridLayout(1,2, 15,15));
         setDefaultCloseOperation(DISPOSE_ON_CLOSE);
         setSize(300,80);
         cmbStatus = new JComboBox(StateApt.values());
         add(cmbStatus);

         JButton btnOk = new JButton("OK");
         add(btnOk);
         btnOk.addActionListener(new ActionListener(){

            public void actionPerformed(ActionEvent arg0) {
               dispose();
            }
         });

   }

   public StateApt getStatus() {
        return _status;
    }

   public void setStatus(StateApt _status) {
        this._status = _status;
    }
   
   public StateApt mostrar(){
      setLocation(MouseInfo.getPointerInfo().getLocation());
      setVisible(true);
      return (StateApt)cmbStatus.getSelectedItem();
   }


}
